/*******************************************************************************
LevelEntity.cpp

Notes:
*******************************************************************************/

#include "LevelEntity.h"

// Use this if the type is "Level"
const std::string LevelEntity::Type = "Level";

//	LevelEntity(...)
//		Initializes a level entity
//			entityData - The information used for initialization
LevelEntity::LevelEntity(EntityResource& entityData)
{
	// Initialize location and size
	m_x = (float)atoi(entityData.GetProperty("X").c_str());
	m_y = (float)atoi(entityData.GetProperty("Y").c_str());
	m_width = (float)atoi(entityData.GetProperty("Width").c_str());
	m_height = (float)atoi(entityData.GetProperty("Height").c_str());

	// Default a level to a boundary
	m_isBounds = true;

	// Default scores
	m_leftScore = 0;
	m_rightScore = 0;
} // LevelEntity

//	AddPoint(bool bIsLeft)
//		Adds to the score for the appropriate player
void LevelEntity::AddPoint(bool bHitLeft)
{
	// If it hit the left side
	if(bHitLeft)
	{
		// increase the other side's score
		m_rightScore++;
	} // if
	// If it hit the right side
	else
	{
		// increase the other side's score
		m_leftScore++;
	} // else
} // AddPoint